package mybook.routes;

import jgo.RouterPlugin;
import mybook.controller.BookController;

public class BookRoutes {
    public static void configure(RouterPlugin router) {
        BookController bookController = BookController.instance;

        router.get( "/books", bookController::handleGetAllBooks);
        router.addRoute("GET", "/books/:id", bookController::handleGetBook);
        router.post( "/books", bookController::handleAddBook);
        router.addRoute("PUT", "/books/:id", bookController::handleUpdateBook);
        router.addRoute("DELETE", "/books/:id", bookController::handleDeleteBook);
    }
}